<include file="Common:lefter" />
<div class="content-box">
  <div class="content-box-header">
    <h3>{$actionTile}</h3>
  </div>
  <div class="content-box-content">
    <div class="tab-content default-tab" id="tab2">
      <form id="articleForm" action="__APP__/Article/set/?&articleId={$articleInfo.article_id}&p={$nowPage}" method="post">
        <fieldset>
        <div class="item-container">
          <label>标题</label>
          <input class="text-input medium-input datepicker" type="text" id="title" name="title" value="{$articleInfo.title}" />
        </div>
        <div class="item-container">
          <label>分类</label>
          <select name="typeId" class="small-input">
          	<option value="0">默认分类</option>
            <foreach name="typeList" item="tl">
            <if condition="$tl.type_id eq $articleInfo['type_id']">
            <option value="{$tl.type_id}" selected="selected">{$tl.type_name}</option>
            <else/>
            <option value="{$tl.type_id}">{$tl.type_name}</option>
            </if>
            </foreach>
          </select>
        </div>
        <div class="item-container">
          <label>是否置顶</label>
           <if condition="$articleInfo.is_top eq 1">
          <input type="checkbox" name="isTop" checked="checked" />置顶
          <else/>
          <input type="checkbox" name="isTop" />置顶
          </if>
        </div>
        <div class="item-container">
          <label>是否推荐</label>
          <if condition="$articleInfo.is_recommend eq 1">
          <input type="checkbox" name="isRecommend" checked="checked" />推荐
          <else/>
          <input type="checkbox" name="isRecommend" />推荐
          </if>
        </div>
        <div class="item-container">
          <label>标签</label>
          <ul id="tags"></ul>
          <input type="hidden" id="aticleTags" name="aticleTags" value="" />
        </div>
        <div class="item-container">
          <label>排序</label>
          <input class="text-input datepicker" type="text" id="sort" name="sort" value="{$articleInfo.sort}" />
        </div>
        <div class="item-container">
          <input class="button" type="submit" id="submitButton" value="提交" />
        </div>
        </fieldset>
        <div class="clear"></div>
      </form>
    </div>
   
  </div>
</div>
<include file="Common:footer" />
<js href="__PUBLIC__/Script/TagHandler/js/jquery.taghandler.js" />
<js href="__PUBLIC__/Script/TagHandler/js/jquery-ui-1.8.20.custom.js" />
<css href="__PUBLIC__/Script/TagHandler/css/jquery.taghandler.css" />
<css href="__PUBLIC__/Script/TagHandler/css/custom-theme/jquery-ui-1.8.7.custom.css" />
<script type="text/javascript">
	$(function(){
		$('#tags').tagHandler({
			assignedTags: {$assignedTags},
			availableTags: {$availableTags},
			autocomplete: true,
			onAdd: function(tag){
				var addflag = true,tags = $('#tags').tagHandler("getTags");
				jQuery.each(tags, function (i, e) {
					if(tag.toUpperCase()===e.toUpperCase()){
						$('#tags').find('.tagItem').each(function(){
							if($(this).html().toLocaleUpperCase()===tag.toLocaleUpperCase()){
								$(this).animate({opacity: 0.55}).delay(20).animate({opacity: 1}).animate({opacity: 0.55}).delay(20).animate({opacity: 1});
							}
						});
						//$('#log').hide(0).html("标签已存在").show().delay(2000).fadeOut();
						addflag = false;
					}
				});
				return addflag;
			},
			afterAdd:function(){
				tags = $('#tags').tagHandler("getTags");
				$("#aticleTags").val(tags);
			},
			afterDelete:function(){
				tags = $('#tags').tagHandler("getTags");
				$("#aticleTags").val(tags);
			}
		});
	});
</script>